<?php

namespace app\http\middleware;

use app\admin\logic\Auth;
use think\facade\Request;

class Check
{
    public function handle($request, \Closure $next)
    {
        if(Request::module() === 'admin'){
            if(strtolower(Request::controller()) !== 'login' && !Auth::checkLogin()){
                return redirect('admin/login/index');
            }
        }
        return $next($request);
    }
}
